package com.smg.community.setting;

import java.text.SimpleDateFormat;
import java.util.Date;

import javax.servlet.http.HttpServletRequest;



/**
 * @author user
 *
 */
public class ProjectSetting{
	/** 
	 * 项目部署标识
	 * true  -  部署到外网
	 * false -  本地开发,内网测试
	 * */
	public static  boolean IS_DEPLOY = false;
	
	public static final int DEFAULT_PAGE_SIZE = 25 ; 
	
	/**
	 * 所有缓存map的默认大小
	 * 因为hashmap的默认大小为12，还是 16
	 * 明显不够用 11
	 * 定义1000个，减少rehash次数
	 */   
	public static final int DEFULT_MAP_SIZE = 1000;

	static {
		
	} 
	/**
	 * 存放Session中的用户key
	 * */
	public static final String SESSION_USER_KEY = "SESSION_USER";
	
	/**
	 * 存放Session中的用户权限key
	 * */
	public static final String SESSION_USER_RIGHT = "loginUserRightList";
	
	public static final String ADMIN_USER_EMAIL = "yushengbing@ddmap.com";
	public static final String EMAIL_MAQI = "564495732@qq.com";
	public static final String EMAIL_WANGMENG = "380179001@qq.com";
	
	public static final String ADMIN_USER = "俞升兵";         
	
	public static String IMAGE_URL_PREFIX = "";
	static 
	{
		if ( IS_DEPLOY){
			IMAGE_URL_PREFIX = "http://img3.ddmapimg.com/";
		}else{
			IMAGE_URL_PREFIX ="http://localhost:8080/images/";
		}
		
	}
	
	public static String getPathByDate(HttpServletRequest request){
		String path = "";
		if(IS_DEPLOY == true) {
			//path = "/ddmap/wap/images/uploadimage/"; 172.16.1.22上目录
			path = "/ddmap/image/crm/"; // 172.16.1.157上目录
			
		}else{
			path = request.getSession().getServletContext().getRealPath("/images/crm/");
			//path = "E:\\ddmap\\image\\crm\\";
		}
		//return "ddmap/wapimage/crmImg/" + new SimpleDateFormat("yyyy-MM-dd").format(new Date());
		//return "uploadimage/" + new SimpleDateFormat("yyyy-MM-dd").format(new Date());
		return   path +"/"+ new SimpleDateFormat("yyyy-MM-dd").format(new Date());
	}
	
	
}